import React, { Component } from "react";
import { observable, action ,observe } from "mobx";
import { observer} from "mobx-react"
import ReactDom from "react-dom";


class Stroe {
    @observable num = 0;
    @action.bound add() {
        this.num = this.num + 1;
    }
}


let store = new Stroe();

@observer
class Counter extends Component {
    render() {
        return (
            <div>
                <p>{store.num}</p>
                <button onClick={store.add}>添加+</button>
            </div>
        )
    }
}
ReactDom.render(<Counter />, document.querySelector("#app"));